import { NamePath } from 'rc-field-form/es/interface';

export class Utils {
  public static createNamePath(name?: string, index?: number): NamePath {
    if (index === undefined || isNaN(index)) {
      return name;
    }

    if (name) {
      return [index, name];
    }

    return undefined;
  }
}
